# $LastChangedDate: 2011-09-24 19:07:25 -0400 (Sat, 24 Sep 2011) $
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
# cmake -DREL=1            (release, strip symbols, default)
#       -DRELMIN=1         (release, strip symbols, optimize for size)
#       -DRELSYM=1         (release, with symbols)
#       -DDEBUG=1|2        (debug level, assertions, debug symbols, never used since my code is perfect)
#       -DDEBMIN=1|2       (debug level, assertions, no debug symbols)
#       -DDEBUGGER=1       (enable options to help a debugger get all symbols)
#       -DPROFILE[_NO_OPT] (profile, no optimizations)
#       -DPROFILE_OPT      (profile, optimizations)
#       -DVERBOSE=1        (compiles logging)
#       -DNO_CHECKS=1      (skip scripts that check source code, only for very slow computers)
# make VERBOSE=1
#-------------------------------------------------------------------------------

CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
SET( PUBLIC_RELEASE "TRUE" )

INCLUDE( CMakeModules/project.cmake )

PROJECT_BEGIN( palomino )

# Compiler.
ADD_DEFINITIONS( -DCOMPILE_PALOMINO=3 )
ADD_DEFINITIONS( -DCOMPILE_OSG=1 -DGFXSYS_OSG=1 )
ADD_DEFINITIONS( -DCOMPILE_HW_LIGHT=1 )

# Required libraries.
COMPILE_WITH_OPENGL()
COMPILE_WITH_OPENSCENEGRAPH()
SET( REQUIRE_ZLIB "TRUE" )
COMPILE_WITH_ZLIB()

# Optional libraries.
# Some can coexist such as Linux and SDL joystick drivers,
# but some are mutually-exclusive such as SDL vs. PLIB.
COMPILE_WITH_POSIX_REALTIME()
COMPILE_WITH_LINUX_JOYSTICK()
COMPILE_WITH_SDL()
IF( SDL_FOUND )
    COMPILE_WITH_SDL_MIXER()
ENDIF()
IF( NOT SDLMIXER_FOUND )
    COMPILE_WITH_PLIB()
ENDIF()
COMPILE_WITH_FLTK()
IF( OSSIM )
    COMPILE_WITH_OSSIM()  # see README_OSSIM.txt
ENDIF()

# Update tools/clean.sh after adding modules.
# Modules are compiled from basic-to-advanced
# while libraries are catenated/linked in advanced-to-basic order.
BUILD_MODULE( base )
BUILD_MODULE( glue )
IF( COMPILE_THREADS )
BUILD_MODULE( threads )
ENDIF()
BUILD_MODULE( math )
BUILD_MODULE( gfx )
BUILD_MODULE( physics )
BUILD_MODULE( input )
BUILD_MODULE( control )
BUILD_MODULE( collision )
BUILD_MODULE( shader )
BUILD_MODULE( fx )
BUILD_MODULE( graph )
BUILD_MODULE( object )
BUILD_MODULE( view )
BUILD_MODULE( sound )
BUILD_MODULE( hud )
IF( FLTK_FOUND )
BUILD_MODULE( gui )
ENDIF( FLTK_FOUND )
BUILD_MODULE( world )
BUILD_MODULE( sky )
BUILD_MODULE( game )
BUILD_MODULE( lua_lang )
BUILD_MODULE( lua_bind )
BUILD_MODULE( init )
BUILD_MODULE( program )  # defines project target

PROJECT_END()
